package cn.icybear.orzjisp.bytefile;

import cn.icybear.orzjisp.Command;

public interface OrzConstants {
	public static final int ORZ_MAGIC = 0x4F727AF0;
	public static final int ORZ_VERSION = 0x00020001;
	public static final byte TAG_CONSTANT = 1;
	public static final byte TAG_CODE = 2;
	public static final byte TAG_STRING = 3;
	public static final byte TAG_INTEGER = 4;
	public static final byte TAG_DOUBLE = 5;
	public static final byte TAG_IDENTIFIER = 6;
	public static final byte TAG_CLOSERTABLE = 7;
	public static final byte TAG_LINE_NUMBER_TABLE = 8;
	
	public static final int TRUE = -1;
	public static final int FALSE = 0;

	public static final byte BYTE_IF = (byte) (1);
	public static final byte BYTE_LAMBDA = (byte) (4);
	public static final byte BYTE_LIST = (byte) (6);
	public static final byte BYTE_CALL = (byte) (7);
	public static final byte BYTE_NOP = (byte) (8);
	public static final byte BYTE_PUSHD = (byte) (9);
	public static final byte BYTE_POPD = (byte) (10);
	public static final byte BYTE_JZ = (byte) (11);
	public static final byte BYTE_JNZ = (byte) (12);
	public static final byte BYTE_JMP = (byte) (13);
	public static final byte BYTE_PLUS = (byte) (14);
	public static final byte BYTE_MINUS = (byte) (15);
	public static final byte BYTE_MULTIPLY = (byte) (16);
	public static final byte BYTE_DIVIDE = (byte) (17);
	public static final byte BYTE_EQ = (byte) (18);
	public static final byte BYTE_NE = (byte) (19);
	public static final byte BYTE_LT = (byte) (20);
	public static final byte BYTE_LE = (byte) (21);
	public static final byte BYTE_GT = (byte) (22);
	public static final byte BYTE_GE = (byte) (23);
	public static final byte BYTE_AND = (byte) (24);
	public static final byte BYTE_OR = (byte) (25);
	public static final byte BYTE_XOR = (byte) (26);
	public static final byte BYTE_CONS = (byte) (27);
	public static final byte BYTE_CAR = (byte) (28);
	public static final byte BYTE_CDR = (byte) (29);
	public static final byte BYTE_IS_PAIR = (byte) (30);
	public static final byte BYTE_IS_NULL = (byte) (31);
	public static final byte BYTE_GETS = (byte) (32);
	public static final byte BYTE_PUTS = (byte) (33);
	public static final byte BYTE_LOAD = (byte) (34);
	public static final byte BYTE_STORE = (byte) (35);
	public static final byte BYTE_NEG = (byte) (36);
	public static final byte BYTE_PUSH = (byte) (37);
	public static final byte BYTE_POP = (byte) (38);
	public static final byte BYTE_LDC = (byte) (39);
	public static final byte BYTE_RET = (byte) (40);
	public static final byte BYTE_REM = (byte) (41);
	public static final byte BYTE_NOT = (byte) (42);

	public static final Command CMD_IF = new Command(BYTE_IF);
	public static final Command CMD_LAMBDA = new Command(BYTE_LAMBDA);
	public static final Command CMD_LIST = new Command(BYTE_LIST);
	public static final Command CMD_CALL = new Command(BYTE_CALL);
	public static final Command CMD_NOP = new Command(BYTE_NOP);
	public static final Command CMD_PUSHD = new Command(BYTE_PUSHD);
	public static final Command CMD_POPD = new Command(BYTE_POPD);
	public static final Command CMD_JZ = new Command(BYTE_JZ);
	public static final Command CMD_JNZ = new Command(BYTE_JNZ);
	public static final Command CMD_JMP = new Command(BYTE_JMP);
	public static final Command CMD_PLUS = new Command(BYTE_PLUS);
	public static final Command CMD_MINUS = new Command(BYTE_MINUS);
	public static final Command CMD_MULTIPLY = new Command(BYTE_MULTIPLY);
	public static final Command CMD_DIVIDE = new Command(BYTE_DIVIDE);
	public static final Command CMD_EQ = new Command(BYTE_EQ);
	public static final Command CMD_NE = new Command(BYTE_NE);
	public static final Command CMD_LT = new Command(BYTE_LT);
	public static final Command CMD_LE = new Command(BYTE_LE);
	public static final Command CMD_GT = new Command(BYTE_GT);
	public static final Command CMD_GE = new Command(BYTE_GE);
	public static final Command CMD_AND = new Command(BYTE_AND);
	public static final Command CMD_OR = new Command(BYTE_OR);
	public static final Command CMD_XOR = new Command(BYTE_XOR);
	public static final Command CMD_CONS = new Command(BYTE_CONS);
	public static final Command CMD_CAR = new Command(BYTE_CAR);
	public static final Command CMD_CDR = new Command(BYTE_CDR);
	public static final Command CMD_IS_PAIR = new Command(BYTE_IS_PAIR);
	public static final Command CMD_IS_NULL = new Command(BYTE_IS_NULL);
	public static final Command CMD_GETS = new Command(BYTE_GETS);
	public static final Command CMD_PUTS = new Command(BYTE_PUTS);
	public static final Command CMD_LOAD = new Command(BYTE_LOAD);
	public static final Command CMD_STORE = new Command(BYTE_STORE);
	public static final Command CMD_NEG = new Command(BYTE_NEG);
	public static final Command CMD_PUSH = new Command(BYTE_PUSH);
	public static final Command CMD_POP = new Command(BYTE_POP);
	public static final Command CMD_RET = new Command(BYTE_RET);
	public static final Command CMD_REM = new Command(BYTE_REM);
	public static final Command CMD_NOT = new Command(BYTE_NOT);
	public static String[] CODE_NAME = new String[] { null, // 0
			"IF", // 1
			null,// "LET", // 2
			null,// "DO", // 3
			"LAMBDA", // 4
			null,// "DEFINE", // 5
			"LIST", // 6
			"CALL", // 7
			"NOP", // 8
			"PUSHD", // 9
			"POPD", // 10
			"JZ", // 11
			"JNZ", // 12
			"JMP", // 13
			"PLUS", // 14
			"MINUS", // 15
			"MULTIPLY", // 16
			"DIVIDE", // 17
			"EQ", // 18
			"NE", // 19
			"LT", // 20
			"LE", // 21
			"GT", // 22
			"GE", // 23
			"AND", // 24
			"OR", // 25
			"XOR", // 26
			"CONS", // 27
			"CAR", // 28
			"CDR", // 29
			"IS_PAIR", // 30
			"IS_NULL", // 31
			"GETS", // 32
			"PUTS", // 33
			"LOAD", // 34
			"STORE", // 35
			"NEG", // 36
			"PUSH", // 37
			"POP", // 38
			"LDC", // 39
			"RET", // 40
			"REM", // 41
			"NOT", // 42
			null };
}
